Added ability for auto scale theme to screen size.#47
Added ability for auto scale theme to screen size.#473lack5ky wants to merge 3 commits intoLyliya:masterfrom
Conversation
Added ability to scale the theme automatically to the display_size.y. If theme has number as scale nothing changes, if theme has string as scale e.g. "1.0" scale will automatically be changed and can be adjusted by changing the number. For Scale = "1.0": Y size = automatic scale setting. 1080 = 0.700 1200 = 0.769 1440 = 0.907 1600 = 1.000 2400 = 1.461
Adjusted Values. Example for scale "1.0": Y size = scale in menu 1600 = 1.110 1440 = 0.999 1200 = 0.833 1080 = 0.750 Example for Scale "0.9": Y size = scale in menu 1600 = 0.999 1440 = 0.899 1200 = 0.749 1080 = 0.675
|
Hey @3lack5ky, thanks for your contribution Can you explain how you get the value for the expression |
|
Hey Lyliya, I took a theme as an example (Marker by Arubinu42), I changed the resolution to 2560x1600 and adjusted the scale manually to fit the theme perfectly to the clock. I noted down the Y value (1600) and the scale value (1.110). Then I changed the resolution to a very small one 1280x720 and adjusted the theme to fit there perfectly. Then I also noted down the Y value (720) and the scale value (0.500). Then I did some math: The formula for linear interpolation between two points (x1,y1) and (x2,y2): Substituting the values: Simplyfied the formula: And finally with the variables from the code: |
|
@3lack5ky This make sense I will try to check this soon, but it may be a good idea to apply this to all theme 🤔 |
|
Yeah all themes could be changed to do auto scale. But we would have to determine the intended base scale for each one. On some like „Marker“ that’s pretty easy, but on some it‘s not so obvious, what is the intended scale by the author. But that would also not be a big deal, since the user can always change the scale manually, if he prefers to have a different scale. |
The scale value accepts a string now, but is also fully compatible with any normal theme. If a string is entered it calculates the scale when the reset button is pressed. The scale can be adjusted by changing the scale value as a string.
Example for scale "1.0":
Y size = scale in menu
1600 = 1.110
1440 = 0.999
1200 = 0.833
1080 = 0.750
Example for Scale "0.9":
Y size = scale in menu
1600 = 0.999
1440 = 0.899
1200 = 0.749
1080 = 0.675
I also uploaded some _AutoScale themes on my fork of the RocketStats_themes as examples for testing.